<template>
  <div class="contentLayout">
    <Snackbar/>
    <van-cell-group>
      <van-cell title="修改密码" is-link @click="open(1)"/>
      <van-cell title="修改信息" is-link @click="open(2)"/>
    </van-cell-group>
    <div class="btnLayout">
      <p class="out" v-on:click="out">退出登录</p>
    </div>
  </div>
</template>

<script>
  import Snackbar from '@/components/Snackbar/index'
  import {removeToken} from '@/utils/auth'

  export default {
    name: "setting",
    components: {Snackbar},
    methods:{
      open(type){
        if(type == 1){
          this.$router.push({path:'/editPassword'})
        }else if(type == 2){
          this.$router.push({path:'/editInfo'})
        }
      },
      out(){
        removeToken();
        this.$router.replace('/');
      }
    }
  }
</script>
<style lang="scss" scoped>
  @import './index.scss';
</style>

